package code._13io.charstream._01introduction;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;

public class Demo {
    public static void main(String[] args) throws IOException {
        File file = new File("fileTest\\a.txt");
        FileInputStream in = new FileInputStream(file);
        byte[] bytes = new byte[11];
        int readCount;
        while((readCount=in.read(bytes))!=-1){
            String s = new String(bytes, 0, readCount);
            System.out.println(s);
        }

        long fileLength = file.length();
        System.out.println("fileLength = " + fileLength);
        in.close();
    }
}
